home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_068 / mg1b / sys / amiga / spawn.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  950b  |  39 lines

  1. /*
  2.  * Name:    MicroEMACS
  3.  *        Spawn an AmigaDOS subprocess
  4.  * Version:    Gnu30
  5.  * Last edit:    17-Aug-1986
  6.  * By:        ...!ihnp4!seismo!ut-sally!ut-ngp!mic
  7.  */
  8.  
  9. #include <libraries/dos.h>
  10. #include <libraries/dosextens.h>
  11. #undef TRUE
  12. #undef FALSE
  13. #include "def.h"        /* AFTER system files to avoid redef's */
  14.  
  15. /*
  16.  * Create a subjob with a copy of the command intrepreter in it.
  17.  * This is really a way to get a new copy of the CLI, because
  18.  * we don't wait around for the new process to quit.  Note the use
  19.  * of a file handle to nil: to avoid the "endcli" message going out
  20.  * to Emacs's standard output.
  21.  */
  22.  
  23. spawncli(f, n, k)
  24. {
  25.     struct FileHandle *nil, *Open();
  26.     
  27.     ewprintf("[Starting new CLI]");
  28.     nil = Open("NIL:", MODE_NEWFILE);
  29.     if (nil == (struct FileHandle *) 0) { /* highly unlikely */
  30.         ewprintf("Can't create nil file handle");
  31.         return (FALSE);
  32.     }
  33.     Execute("NEWCLI \"CON:0/0/640/200/MicroEmacs Subprocess\"",nil,nil);
  34.     Close(nil);
  35.     return (TRUE);
  36. }
  37.  
  38.  
  39.